package com.marketManage;

import java.util.Date;

public class Member implements Comparable<Member> {
	private String name;
	private int cardNumber;
	private String password;
	private int integral;
	private Date cardOpenDate;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getCardNumber() {
		return cardNumber;
	}

	public void setCardNumber(int cardNumber) {
		this.cardNumber = cardNumber;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getIntegral() {
		return integral;
	}

	public void setIntegral(int integral) {
		this.integral = integral;
	}

	public Date getCardOpenDate() {
		return cardOpenDate;
	}

	public void setCardOpenDate(Date cardOpenDate) {
		this.cardOpenDate = cardOpenDate;
	}

	@Override
	public String toString() {
		return "会员信息： [会员名：" + name + ", 会员卡号：" + cardNumber + ", 会员密码：" + password + ", 会员积分：" + integral + ", 开卡日期："
				+ cardOpenDate + "]";
	}

//	@Override
//	public int hashCode() {
//		final int prime = 31;
//		int result = 1;
//		result = prime * result + cardNumber;
//		return result;
//	}
//
//	@Override
//	public boolean equals(Object obj) {
//		if (this == obj)
//			return true;
//		if (obj == null)
//			return false;
//		if (getClass() != obj.getClass())
//			return false;
//		Member other = (Member) obj;
//		if (cardNumber != other.cardNumber)
//			return false;
//		return true;
//	}

	public Member(String name, int cardNumber, String password, int integral, Date cardOpenDate) {
		super();
		this.name = name;
		this.cardNumber = cardNumber;
		this.password = password;
		this.integral = integral;
		this.cardOpenDate = cardOpenDate;
	}

	@Override
	public int compareTo(Member o) {
		// TODO Auto-generated method stub
		return this.cardNumber - o.cardNumber;
	}

}
